import request from '@/utils/request'
const baseURL = 'http://localhost:3000'

export function fetchList(params) {
    return request({
        url: `${baseURL}/gift/list`,
        method: 'get',
        params: {
            ...params
        }
    })
}

export function fetchById(params) {
    return request({
        params,
        url: `${baseURL}/gift/getById`,
        method: 'get',
    })
}

export function update(params) {
    return request({
        url: `${baseURL}/gift/updatePlaylist`,
        data: {
            ...params
        },
        method: 'post',
    })
}

export function add(params) {
    return request({
        url: `${baseURL}/gift/addgiftlist`,
        data: {
            ...params
        },
        method: 'post',
    })
}

//删除数据
export function del(params) {
    return request({
        params,
        url: `${baseURL}/gift/del`,
        method: 'get',
    })
}